package com.ruoyi.core.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.core.lock.ULock;
import com.ruoyi.core.service.SuggestService;
import com.ruoyi.core.vo.SuggestCreateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Author xiaom
 * @Date 2021/6/5 10:06
 * @Version 1.0.0
 * @Description <>
 **/
@RestController
@Validated
@Api(tags = "意见反馈")
@RequestMapping("/suggest")
public class SuggestController extends BaseController {

    @Autowired
    private SuggestService suggestService;

    @PostMapping("/add")
    @ApiModelProperty("意见反馈提交")
    @ULock
    public AjaxResult add(@RequestBody @Valid SuggestCreateVo suggestCreateVo){
        suggestService.add(suggestCreateVo);
        return AjaxResult.success();
    }

}
